<template>
    <div class="detail">
        <!-- 条款更新详情 -->
        <div class="detail-content" v-for="(item, index) in additionalProperties1" :key="index">
            <div>
                <!-- <span>更新类型：<span style="color:red; font-weight: bold;">{{item.modifyType == '1' ? '新增' : (item.modifyType == '2' ? '修改' : '删除')}}</span></span> -->
                <span>更新类型：<span style="color:red; font-weight: bold;">{{setModifyType(item.modifyType)}}</span></span>
                <span style="padding: 0px 15px">更新时间：{{dateFormat(item.modifyDate)}} {{timeFormat(item.modifyTime)}}</span>
                <span>更新人：{{item.modifyUser}}</span>
            </div>
            <div style="margin-top: 10px" v-for="(item2, index2) in item.modifyText" :key="index2">
                <div v-show="item2.riskModifyTypeEnum == '1'">
                    <span class="edit-color">{{ item2.moduleDetail }}：</span>
                    <span class="edit-color" style="color:#ec808d"> {{ isNaN(item2.afterChange)? item2.afterChange : numberFormat(item2.afterChange) }} </span>
                </div>
                <div v-show="item2.riskModifyTypeEnum == '2'">
                    <span class="edit-type">{{ item2.moduleDetail }} :</span> <span class="edit-color" style="color:#ec808d">{{ isNaN(item2.beforeChange)? item2.beforeChange : numberFormat(item2.beforeChange) }}</span> ->
                    <span class="edit-color" style="color:#ec808d"> {{ isNaN(item2.afterChange)? item2.afterChange : numberFormat(item2.afterChange) }} </span>
                </div>
                <div v-show="item2.riskModifyTypeEnum == '3'">
                    <span class="edit-color">{{ item2.moduleDetail }}：</span>
                    <span class="edit-color" style="color:#ec808d"> {{ isNaN(item2.afterChange)? item2.beforeChange : numberFormat(item2.beforeChange) }} </span>
                </div>    
            </div>
        </div>
    </div>
</template>
<script lang="ts">
import { Component, Vue, Watch, Prop } from 'vue-property-decorator';
import { numberFormat, dateFormat, timeFormat } from '@/utils/tools';
@Component({
    name: 'UpdateDetails',
    components: {
    },
})
export default class UpdateDetails extends Vue {
    @Prop() categoryNodeDialog;
    @Prop() additionalProperties1;
    private dialogVisible: boolean = false;
    numberFormat = numberFormat;
    dateFormat = dateFormat;
    timeFormat = timeFormat;
    mounted() {
    }
    setModifyType(type) {
        console.log('hzj=操作记录类型', type)
        if (type === '1') {
            return '新增条款'
        } else if (type == '2') {
            return '修改条款'
        } else if (type == '3') {
            return '删除条款'
        } else if (type == '4') {
            return '新增条目'
        } else if (type == '5') {
            return '添加关联条目'
        } else if (type == '6') {
            return '解除关联条目'
        }
    }
}
</script>
<style lang="scss" scoped>
.detail {
    max-height: 32vh;
    color: #575757;
    overflow: auto;
    border: 1px solid #d7d7d7;
    padding-bottom: 10px;
}
.detail-content {
    width: 98%;
    margin: 0 auto;
    border-bottom: 1px solid #d7d7d7;
    padding: 10px 20px;
}
</style>
